TUTORIAL TO RUN TERRAIN IN MM5 1. Initially download 5 files which we use here in GCISC, to start running the MM5 model a. INTERPF.TAR b. MM5.TAR c. MM5toGrADS.tar d. TERRAIN.TAR e. REGRID.TAR These files can be downloaded from the following link ftp://ftp.ucar.edu/mesouser/MM5V3 2. Untar TERRAIN.TAR by typing the following command in the konsole tar -xvf TERRAIN.TAR 3. In the TERRAIN folder make following changes in the Makefile a. Comment line 15 and uncomment line 16, as follows #NCARGRAPHICS = NCARG NCARGRAPHICS = NONCARG This is because we are using Grads as our graphics display program. b. Next go to line 121, and make the following changes "LOCAL_LIBRARIES= -L$(PGI)/linux86/5.0/lib" ) ; \ Since we are using the PGI compiler instead of the compiler of NCAR. 3. Type make terrain.deck in the konsole of the TERRAIN folder. 4. Kwrite terrain.deck 5. Make the following changes in this file a. 8 #set ftpdata = true 9 set ftpdata = false FTP(File Transfer Protocol) is a protocol(An agreed-upon format for transmitting data between two devices) for transferring files over the internet. We are transferring Data from some local device which is the reason we have set it to false. b. 13 #set Where30sTer = ftp 14 set Where30sTer = /path-of-data (Data used for topography, landuse, etc.) c. 38 PARAMETER (IIMX = 250, JJMX = 250, NSIZE = IIMX*JJMX) d. 53 C PARAMETER (ITRH = 500, JTRH = 500, NOBT = ITRH*JTRH) 54 PARAMETER (ITRH = 1500, JTRH = 1800, NOBT = ITRH*JTRH) e. 64 PHIC = 28.0, ; CENTRAL LATITUDE (minus for southern hemesphere) 65 XLONC = 75.0, ; CENTRAL LONGITUDE (minus for western hemesphere) f. 69 ;IPROJ = 'LAMCON', ; LAMBERT-CONFORMAL MAP PROJECTION 70 ;IPROJ = 'POLSTR', ; POLAR STEREOGRAPHIC MAP PROJECTION 71 IPROJ = 'MERCAT', ; MERCATOR MAP PROJECTION For latitudes less than 30 degrees, we use the MERCATOR projection. For greater than 30 we use the POLAR projection. And for large values LAMCON is used. g. 75 MAXNES = 1, ; NUMBER OF DOMAINS TO PROCESS 76 NESTIX = 35, 49, 136, 181, 211, 221, ;GRID DIMENSIONS IN Y DIRECTION 78 NESTJX = 41, 52, 181, 196, 211, 221, ;GRID DIMENSIONS IN X DIRECTION 79 DIS = 20., 30., 9., 3.0, 1.0, 1.0, ; GRID DISTANCE h. 246 # should I ftp the data? 247 # 248 #if ( $ftpdata == true && $?BotSoil ) then 249 # ftp other data plus top soil data 250 # echo 'about to start ftping' 251 # cp Data/ftp2.csh ftp.csh 252 # chmod +x ftp.csh 253 # ./ftp.csh >& ftp.out 254 # rm ftp.csh ftp.out 255 #else 256 # ftp other data plus bottom soil data 257 # echo 'about to start ftping' 258 # cp Data/ftp.csh ftp.csh 259 # chmod +x ftp.csh 260 # ./ftp.csh >& ftp.out 261 # rm ftp.csh ftp.out 262 #endif i. 275 #unlimit 6. One important thing to consider is the following. Once you choose the particular input data resolution from the following menu: ; 1: 1 deg (~111 km) global terrain and landuse ; 2: 30 min ( ~56 km) global terrain and landuse ; 3: 10 min ( ~19 km) global terrain and landuse ; 4; 5 min ( ~9 km) global terrain and landuse ; 5; 2 min ( ~4 km) global terrain and landuse ; 6; 30 sec ( ~.9 km) global terrain and landuse in the following line, NTYPE = 3, 4, 4, 6, 6, 6, ; INPUT DATA RESOLUTION It will be mandatory to place that data set in the Data directory of the TERRAIN folder, else terrain.deck will not execute, and TERRAIN_DOMAIN will not be created. 7. Run ./terrain.deck in the terrain folder. 8. The run will be successful if four exe files are created in the src folder. 1- data_area.exe 2- rdem.exe 3- rdnml 4- terrain.exe 5. TERRAIN_DOMAIN1 (in the TERRAIN folder) MM5TOGRADS 1. Once the file TERRAIN_DOMAIN is created, copy it to the MM5toGrads folder and make the following changes in the mm5_to_grads.csh file in the MM5toGrADs folder, set infilename = "TERRAIN_DOMAIN1" set outfilename = "test" (the name of the output file .ctl) When running MM5toGrADS in the future you would just have to enter the path rather than copying the file in the folder. Two further steps will create the test.ctl file; 1. Type "make & makeout" in the konsole. 2. Type ./mm5_to_grads.csh in the konsole. The test.ctl can know be edited in grads. REGRID 1. How to run PREGRID? First of all gunzip and untar the REGRID.tar.gz file. In the REGRID folder, type 'make' in konsole. If successful the following files will be created /pregrid/on84/pregrid_on84.exe /pregrid/navysst/pregrid_navy.exe /pregrid/ncep.grib/pregrid_ncep.exe /pregrid/grib.misc/pregrid_grib.exe /regridder/regridder 2. Now make the following changes in the pregrid.csh file. a. set DataDir = /home/mm5 model/REGRID/pregrid/Data. Create a Data folder in the pregrid directory and copy the data file in the data folder. The data can be obtained from the following location. http://www.mmm.ucar.edu/mm5/mm5v3/data/where_to_find_analyses.html b. 16 set SRC3D = NCEP # Newer GRIB-formatted NCEP GDAS analyses 17 # set SRC3D = GRIB # Many GRIB-format datasets c. 25 set InFiles = ( ${DataDir}/Y*.bin ) since all the files in the Data folder start with Y hence the use of Y* in the above command. d. 33 set SRCSST = $SRC3D (uncomment thi line) e. 43 # set InSST = ( ) f. 49 # set SRCSNOW = $SRC3D g. 58 # set InSnow = () h. Make changes to the following variables as you require; 84 START_YEAR = 2005 # Year (Four digits) 85 START_MONTH = 06 # Month ( 01 - 12 ) 86 START_DAY = 01 # Day ( 01 - 31 ) 87 START_HOUR = 00 # Hour ( 00 - 23 ) 89 END_YEAR = 2005 # Year (Four digits) 90 END_MONTH = 06 # Month ( 01 - 12 ) 91 END_DAY = 15 # Day ( 01 - 31 ) 92 END_HOUR = 00 # Hour ( 00 - 23 ) Make sure the data for these dates you enter is in the Data directory. i. 96 INTERVAL = 21600 # Time interval (seconds) to process. j. 118 #set VTSNOW = ( grib.misc/Vtable.xxxxSNOW ) 119 #set VTSOIL = ( grib.misc/Vtable.xxxxSOIL ) 2. Now run ./pregrid.csh in the pregrid directory. If the run is successfull you should see the following line at the end of the run "Normal termination of program PREGRID_ON84" and files having names beginning with NCEP and NCEP_SST. 3. Now enter the regrid folder you should see the following files: ALMX_FILE Doc/ Makefile SIVT_FILE:--- namelist.input src/ 4. Enter the namelist.input file and make changes to the dates as you require. Modify line 25-27 as follows root = '../pregrid/NCEP' '../pregrid/NCEP_SST' '../pregrid/ON84_SNOW' terrain_file_name = '../../TERRAIN/TERRAIN_DOMAIN1' / constants_full_name = './ALMX_FILE' '../pregrid/SST_FILE:2005-06-3_00' Note: if a pregrid output file name is NCEP_SST:2001-05-16_00, then the root name is NCEP_SST. 5. Once this is done run ./regridder.exe in the konsole.If the job runs successfully, you should see the following file generated REGRID_DOMAIN1.This is the binary output file that can be used either in RAWINS, LITTLE_R or INTERPF. 6. Now convert the REGRID_DOMAIN1 to ctl form in MM5toGrads folder as before to view the variables. INTERPF -This program takes pressure-level meteorological fields produced either by REGRID, and the user's definition of model sigma levels, and interpolates pressure level data to sigma levels. 1. Untar the INTERPF.TAR file. Now enter the directory and type make in konsole. 2. Edit the namelist.input file. Make changes as input_file = '/home/mm5-model/REGRID/regridder/REGRID_DOMAIN1' / ! pressure-level data file name and enter relevant start and end dates. 3. Run ./interpf. Following files will be generated in the interpf folder: BDYOUT_DOMAIN1 LOWBDY_DOMAIN1 MMINPUT_DOMAIN1 MM5 1. Untar the mm5.tar file. 2. Edit the configure.user file and make the following changes: a. 293 RUNTIME_SYSTEM = "linux" 294 FC = pgf90 295 FCFLAGS = -I$(LIBINCLUDE) -O2 -Mcray=pointer -tp p6 -pc 32 -Mnoframe -byteswapio 296 ##FCFLAGS = -I$(LIBINCLUDE) -O2 -Mcray=pointer -tp p6 -pc 32 -Mnoframe -byteswapio -mp \ 297 ##-Mnosgimp 298 CPP = /lib/cpp 299 CFLAGS = -O 300 CPPFLAGS = -I$(LIBINCLUDE) 301 LDOPTIONS = -O2 -Mcray=pointer -tp p6 -pc 32 -Mnoframe -byteswapio 302 ##LDOPTIONS = -O2 -Mcray=pointer -tp p6 -pc 32 -Mnoframe -byteswapio -mp 303 LOCAL_LIBRARIES = 304 MAKE = make -i -r b. 349 # MAXNES (integer) - Max Number of Domains in simulation 350 MAXNES = 1 351 # 352 # MIX,MJX (integer) - Maximum Dimensions of any Domain 353 MIX = 150 354 MJX = 200 3. MM5 requires output files from INTERPF: MMINPUT_DOMAIN1, BDYOUT_DOMAIN1, and LOWBDY_DOMAIN1. Copy these files to the Run folder in MM5. 4. Type make in the konsole in MM5 folder to compile MM5. 5. Now type "make mm5.deck" in the MM5 folder konsole. In the mm5.deck make the following changes a. 52 TIMAX = 14400., ; forecast length in minutes 53 TISTEP = 60., ; coarse domain DT in model, use 3*DX b. 166 NESTIX = 70, 121, 31, 46, 46, 46, 46, 46, 46, 46, ; domain size i 167 NESTJX = 85, 166, 31, 61, 61, 61, 61, 61, 61, 61, ; domain size j Enter NESTIX and NESTJX as in terrain.deck 6. Type ./mm5.deck in konsole in the MM5 folder. The deck first creates a namelist called mmlif in the Run/ directory, and then starts to execute the mm5 executable. 7. Enter the Run directory and edit the mmlif file. Make changes as you require. Make sure that NESTIX and NESTJX variables are set to the right values. 8. Next run ./mm5.deck in the MM5 directory. If it gives the following message This version of mm5.deck stops after creating namelist file mmlif. Please run code manually. Then running mm5.exe in the Run directory will solve the problem. CHANGES IN TERRAIN FOR MULTIPLE DOMAINS: 2. 75 MAXNES = 2, ; NUMBER OF DOMAINS TO PROCESS 76 NESTIX = 35, 22, 136, 181, 211, 221, ;GRID DIMENSIONS IN Y DIRECTION 78 NESTJX = 41, 31, 181, 196, 211, 221, ;GRID DIMENSIONS IN X DIRECTION 79 DIS = 90., 30., 9., 3.0, 1.0, 1.0, ; GRID DISTANCE There are some things that you have to be careful about when dealing with multiple domains. a. When, say, considering two domains.The ratio of the resolution of the domains (DIS(1)/DIS(2)) must be an 3. And the grids of domain 2 must be 3x+1 , where x is any integer NESTIX in the above case is 3(7)+1. CHANGES IN MM5.DECK FOR MULTIPLE DOMAINS: 1. In configure.user make the following change, a. 350 # MAXNES (integer) - Max Number of Domains in simulation 351 MAXNES = 2 b. # MIX,MJX (integer) - Maximum Dimensions of any Domain MIX = 150 MJX = 150 These numbers should be greater than NESTIX and NESTJX, for any domain. 2. Coloumn 2 is the maximum time length (in minutes) for the run of domain 2 170 XENNES =1440.,23040.,1440.,720.,720.,720.,720.,720.,720.,720.; domain termination which is 16 days for this case. 3. If running mm5 for multiple domains, the following files TERRAIN_DOMAINx, REGRID_DOMAINx, MMINPUT_DOMAINx, LOWBDY_DOMAINx, and MMOUT_DOMAINx x is the domain number.